<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Applies scaling to a matrix</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="cairomatrix.rotate.html">CairoMatrix::rotate</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="cairomatrix.transformdistance.html">CairoMatrix::transformDistance</a></div>
 <div class="up"><a href="class.cairomatrix.html">CairoMatrix</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="cairomatrix.scale" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">CairoMatrix::scale</h1>
  <h1 class="refname">cairo_matrix_scale</h1>
  <p class="verinfo">(PECL cairo &gt;= 0.1.0)</p><p class="refpurpose"><span class="refname">CairoMatrix::scale</span> -- <span class="refname">cairo_matrix_scale</span> &mdash; <span class="dc-title">Applies scaling to a matrix</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-cairomatrix.scale-description">
  <h3 class="title">说明</h3>
  <p class="para">面向对象风格 (method):</p>
   <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type"><span class="type void">void</span></span> <span class="methodname"><strong>CairoMatrix::scale</strong></span>
    ( <span class="methodparam"><span class="type">float</span> <code class="parameter">$sx</code></span>
   , <span class="methodparam"><span class="type">float</span> <code class="parameter">$sy</code></span>
    )</div>

  <p class="para rdfs-comment">过程化风格:</p>
  <div class="methodsynopsis dc-description">
   <span class="type"><span class="type void">void</span></span> <span class="methodname"><strong>cairo_matrix_scale</strong></span>
    ( <span class="methodparam"><span class="type"><a href="class.cairocontext.html" class="type CairoContext">CairoContext</a></span> <code class="parameter">$context</code></span>
   , <span class="methodparam"><span class="type">float</span> <code class="parameter">$sx</code></span>
   , <span class="methodparam"><span class="type">float</span> <code class="parameter">$sy</code></span>
   )</div>

  <p class="para rdfs-comment">
    Applies scaling by sx, sy to the transformation in the matrix. The effect of
    the new transformation is to first scale the coordinates by sx and sy, then
    apply the original transformation to the coordinates.
  </p>
 
 </div>


 <div class="refsect1 parameters" id="refsect1-cairomatrix.scale-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">matrix</code></em></dt>

     <dd>

      <p class="para">
       Procedural only - CairoMatrix instance
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">sx</code></em></dt>

     <dd>

      <p class="para">
       scale factor in the X direction 
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">sy</code></em></dt>

     <dd>

      <p class="para">
       scale factor in the Y direction 
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-cairomatrix.scale-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-3091">
    <p><strong>Example #1 面向对象风格</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">/*&nbsp;Apply&nbsp;scaling&nbsp;to&nbsp;a&nbsp;matrix&nbsp;*/<br /></span><span style="color: #0000BB">$matrix&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">CairoMatrix</span><span style="color: #007700">(</span><span style="color: #0000BB">1.0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0.5</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0.0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">1.0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0.0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0.0</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$matrix</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">scale</span><span style="color: #007700">(</span><span style="color: #0000BB">0.2</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">2.0</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
     </div>

   </div>
  </p>
  <p class="para">
   <div class="example" id="example-3092">
    <p><strong>Example #2 过程化风格</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">/*&nbsp;Apply&nbsp;scaling&nbsp;to&nbsp;a&nbsp;matrix&nbsp;*/<br /></span><span style="color: #0000BB">$matrix&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">cairo_matrix_init</span><span style="color: #007700">(</span><span style="color: #0000BB">1.0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0.5</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0.0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">1.0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0.0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0.0</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">cairo_matrix_scale</span><span style="color: #007700">(</span><span style="color: #0000BB">$matrix</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0.2</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">2.0</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
     </div>

   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-cairomatrix.scale-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="methodname"><a href="cairomatrix.initscale.html" class="methodname" rel="rdfs-seeAlso">CairoMatrix::initScale()</a> - Creates a new scaling matrix</span></li>
   </ul>
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="cairomatrix.rotate.html">CairoMatrix::rotate</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="cairomatrix.transformdistance.html">CairoMatrix::transformDistance</a></div>
 <div class="up"><a href="class.cairomatrix.html">CairoMatrix</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
